home *** CD-ROM | disk | FTP | other *** search
- Path: news.umbc.edu!not-for-mail
- From: schlein@umbc.edu (Jonas J. Schlein)
- Newsgroups: comp.lang.c
- Subject: Re: What the hell is THIS?!
- Date: 13 Jan 1996 00:33:18 -0500
- Organization: University of Maryland Baltimore County
- Message-ID: <4d7g6u$j0l@umbc9.umbc.edu>
- References: <4d6rgh$rfu@abel.cc.sunysb.edu>
- NNTP-Posting-Host: f-umbc9.umbc.edu
- NNTP-Posting-User: schlein
-
- Bommasamudram Madhusudan <bmadhusu@engws12.ic.sunysb.edu> wrote:
- |> hi guys;
- |>
- |> I'm going nuts trying to figure this out;
- |>
- |> Can someone explain what
- |>
- |> int (*p)[3] is?????
- |>
- |> Is this an array of pointers to integers
- |>
- |> OR
- |>
- |> a pointer to an array of integers?? HELP!
-
- According to cdecl:
-
- cdecl> explain int (*p)[3]
- declare p as pointer to array 3 of int
-
- |> I can say things like:
- |>
- |> (*p)[0] = 3; for e.g, but when I print the value using:
- |>
- |> printf("%d",(*p)[0]) I get a core dump!
-
- Exactly...Because it is a pointer, you need to associate some space
- with it via malloc() or the like.
- --
- "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
-
- Jonas J. Schlein (schlein@gl.umbc.edu)
-